General variance and contravariance
Suppose that a group acts transitively on a space . A transformation can be thought of indistinctly as either "moving" the objects in or as a change of "point of view" in the following way:
Suppose we have a comfortable, mathematically speaking, space with a distinguished point, . We are going to think of , for greater ease. Suppose also a bijection (in the line of reasoning of the notes homogeneous space#Intuitive approach and basis and change of basis). It is better to think in terms of . That is, for every we have a kind of "coordinates" for , given by . Think, for example, of a vector space and the isomorphism (fixing a basis in ). We can think of this as our initial point of view, and we can imagine as if we were located at with some devices to take measurements that let us to create .

An element of the group is a transformation, a movement, of into itself.

The world description given by let us define a map in given by
Now, think that we ourselves have been shifted, so we can consider that we have a new point of view of the world before the transformation. That is, the point of view 2 is how the red drawings is seen from the purple person. This new point of view satisfies , or , if you want:

Also, .
The translation of point of view is a map such that
Therefore since
So it turns out that to translate from point of view 2 to point of view 1 you have to substract 6 units, while the change itself has been produced by adding 6 units to the observer.It is impossible to distinguish whether the new description is caused by the world moving or by myself moving in the opposite direction.
Since the change of the "components" is opposite to the "transformation", it is said the the components are contravariant.
Very important example: covariance and contravariance in linear algebra.
Behavior of functions
Suppose a function (in the pictures above think of the "height" of every object). The description given by let us create a "more comfortable" function given by , encoding the same data as in the diagram
Consider a transformation of (think of a shift of +6, por example, in the picture above). What is the new comfortable description of with the new description of ? Since is the red drawings as seen by the purple person, it correspond to shift the graph by 6 units to the left:

Analytically, the new description of is ,
so the new comfortable function is
and
So if, for example, then . Observe then that this corresponds to the elemental fact in high school mathematics that to shift the graph of a function f(x) by units you have to substitute by .
On the other hand, we may be interested in the implicit description of subsets of . How does the zero set of functions transform under ?
Consider , the zero set of . The transformation moves the set to the set . Since if and only if there exists such that , with . Then, , and therefore
i.e. the transformed function is just the function such that its zero set is the transformed of the zero set of . If we had started with instead of we have arrived at the conclusion that is the function whose zeroes are the translated by , and then the function have an interpretation different than above: is the description, in the first point of view, of the implicit function of the translation of by .

Particular cases:
Maybe related: Heisenberg vs Schrodinger picture and states and observables.
________________________________________
________________________________________
________________________________________
Author of the notes: Antonio J. Pan-Collantes
antonio.pan@uca.es